import Koa from 'koa'
import AsyncHooks from 'async_hooks'
let count = 0
export default function invokeController(clazz: Function, method: string): Koa.Middleware {
    return async (ctx, next) => {
        ctx.body = AsyncHooks.executionAsyncId() + `  count ${count++}` + `
        ${(clazz.prototype)[method].toString()}
        `
    }
}
